package com.inwk.valoepi.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

import com.inwk.valoepi.managers.PageManager;

public class StartPage extends Page {

	@FindBy(xpath = "//div[@class='item-wrapper clearfix']//a[contains(@href,'Product-list')]")
	private WebElement buyLink;
	
	@FindBy(xpath = "//div[@class='header-nav-item']//a[contains(@href,'LoginPage')]")
	private WebElement loginLink;
	
	public StartPage(PageManager pm) {
		super(pm);
		// TODO Auto-generated constructor stub
	}
	
	public ShopPage goToShopPage() {
		buyLink.click();
		return pm.shopPage;
	}
	
	public LoginPage goToLoginPage() {
		loginLink.click();
		return pm.loginPage;
	}

	@Override
	public boolean isCurrentPage() {
		if(baseURL.equals(webDriver.getCurrentUrl())) {
			return true;
		}
		return false;
	}

}
